Make the deps_log parser report corrupted files instead of crashing.#2489
Merged
jhasse merged 2 commits intoninja-build:masterfrom Oct 4, 2024
Merged
Make the deps_log parser report corrupted files instead of crashing.#2489jhasse merged 2 commits intoninja-build:masterfrom
jhasse merged 2 commits intoninja-build:masterfrom
Conversation
bea6f78 to
ebbef6c
Compare
Call fopen() with "wb" instead of "w" to avoid translating \n into \r\n on Windows, based on the machine's configuration. This prevents random test breakages on Windows/x64 CI builders that do not happen on Windows/arm64 or other operating systems.
The parser used asserts to verify the consistency of the deps log, which resulted in crashes in production. Replace them with correct checks and return conditions. This allows the parser to survive and report corrupted files, and Ninja to ignore the latter. + Add related unit-test. Fixes ninja-build#2472 Fixes ninja-build#2309
ebbef6c to
197dbdb
Compare
Contributor
Author
|
The Windows/x64 CI builder was failing, but not the Windows/arm64 one!, due to a bug in DiskInterface::WriteFile(). |
Collaborator
|
Awesome stuff, thank you very much for this :) |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The parser used asserts to verify the consistency of the deps log, which resulted in crashes in production. Replace them with correct checks and return conditions.
This allows the parser to survive and report corrupted files, and Ninja to ignore the latter.
Fixes #2472
Fixes #2309